<?php
/*
 $Id$ ecg_cfg_set_bollean_value.php
 ECG, http://www.gtf.16mb.com
 Copyright (c) 2012 Eugene.K
 
 This program is shareware software; all right reserved 
*/

function ecg_cfg_set_boolean_value($select_array, $default, $key = null) 
{
	global $osC_Language;

    $string = '';

    $select_array = explode(',', substr($select_array, 6, -1));

    $name = (!empty($key) ? 'configuration[' . $key . ']' : 'configuration_value');

    for ($i=0, $n=sizeof($select_array); $i<$n; $i++) 
	{
		$value = trim($select_array[$i]);
		
		if (strpos($value, '\'') !== false) 
		{
			$value = substr($value, 1, -1);
		}else
		{
			$value = (int)$value;
		}

      $select_array[$i] = $value;

      if ($value === 'USD') 
	  {
		  $value = 'WMZ';
      }elseif ($value === 'EUR') {
			$value = 'WME';
      }elseif ($value === 'RUB') {
        $value = 'WMR';
      }elseif ($value === 'UAH') {
        $value = 'WMU';
      }elseif ($value === 'BYR') {
        $value = 'WMB';
      }elseif ($value === 'UZS') {
        $value = 'WMY';
      }elseif ($value === 'USDc') {
		  $value = 'USD';
	  }elseif ($value === 'EURc') {
		  $value = 'EUR';
	  }elseif ($value === 'RUBc') {
		  $value = 'RUB';
      }elseif ($value === 'UAHc') {
		  $value = 'UAH';
      }elseif ($value === 'allTypeMode') {
		  $value = $osC_Language->get('payment_ecg_lqp_admin_27');
      }elseif ($value === 'LiqPayMode') {
		  $value = $osC_Language->get('payment_ecg_lqp_admin_28');
      }elseif ($value === 'CreditCardMode') {
		  $value = $osC_Language->get('payment_ecg_lqp_admin_29');
      }elseif ($value === 'RUS') {
		  $value = $osC_Language->get('payment_ecg_wm_admin_41');
      }elseif ($value === 'ENGS') {
		  $value = $osC_Language->get('payment_ecg_wm_admin_42');
      }elseif ($value === 'RU') {
		  $value = $osC_Language->get('payment_ecg_bb_admin_35');
      }elseif ($value === 'UA') {
		  $value = $osC_Language->get('payment_ecg_bb_admin_36');
      }
		  

      $string .= '<input type="radio" name="' . $name . '" value="' . $select_array[$i] . '"';

      if ($default == $select_array[$i]) $string .= ' checked="checked"';

      $string .= '> ' . $value . '<br />';
    }

    if (!empty($string)) 
	{
		$string = substr($string, 0, -6);
    }

    return $string;
}
?>
